package com.wkq.util.transformer

import android.view.View
import androidx.viewpager2.widget.ViewPager2

/**
 *
 *@Author: wkq
 *
 *@Time: 2025/7/28 17:58
 *
 *@Desc: 立体滑动切换（CubeOutTransformer）
 */
class CubeOutTransformer : ViewPager2.PageTransformer {
    override fun transformPage(view: View, position: Float) {
        view.apply {
            pivotX = if (position < 0f) width.toFloat() else 0f
            pivotY = height / 2f
            rotationY = -90f * position
            cameraDistance = 20000f
        }
    }
}
